package poker;

import static org.junit.Assert.*;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class humanTest {
	human test;
	deck d;
	card[] k;
	ServerSocket server;
	player p;

	@Before
	public final void setUp() {
		try {
			server = new ServerSocket(4444);
			d = new deck();
			d.shuffle();

			card[] k = { d.takeCard(), d.takeCard(), d.takeCard(),
					d.takeCard(), d.takeCard() };
			this.k = k;
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		} catch (deckException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		while (true) {
			try {
				test = new human(d, server.accept(),new bidding());
				test.setCards(k);
				test.run();
				p = test;
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}

	@Test
	public final void test() {
		fail();
	}

	@After
	public final void end() {
		try {
			server.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
